﻿using DAL;
using models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
namespace BLL
{
   public class ProductCountMarager
    {
        ProductCountService service = new ProductCountService();
        // 商品组合类型
        //新增 商品组合类型
        public bool AddProductCount(ProductCount productCount ) 
        {
            return service.AddProductCount(productCount);
        }
        //查询所有商品组合类型
        public List<ProductCount> SumProductCount() 
        {
            
            List<ProductCount> counts = new List<ProductCount>();
            SqlDataReader reader = service.SumProductCount();
            while (reader.Read())
            {
                counts.Add(new ProductCount(
                    reader.GetInt32(0),
                    reader.GetString(1)
                    )
                    );
            }
            DBhelper.Close();
            return counts;

        }

    }
}
